//index.js
//获取应用实例
// const app = getApp()
import {request} from '../../request/request.js';
let regeneratorRuntim = require("../../utils/regenerator-runtime/runtime");
Page({
  data: {
    //轮播图
     swiperList:[],
     indicatorDots:true,
     autoplay:true,
     interval:3000,
     duration:1000,
     circular:true,
     indicatorColor:'#000',
     indicatorActiveColor:'#fff',
  //分类
  classifyList:[],
  // 商品列表推荐
  ShopList:[]

  },
  shopTwoList:[],
  onLoad:function() {
    this.SwiperImg();
    this.Classify();
    this.ShopList();
  },
  // 轮播
 async SwiperImg(){
    let res = await request({url:('/home/swiperdata')})
       this.setData({
         swiperList:res.data.message
       })
  },
  // 分类
  async Classify(){
   let res = await request({url:('/home/catitems')});
       this.setData({
        classifyList:res.data.message
       })
  },
  // 商品列表推荐
  async ShopList(){
    let res = await request({url:"/home/floordata"});
    console.log(res.data.message)
//     let query = res.data.message;
//    this.shopTwoList = query.map(v=>v.product_list);
//    let shopp = this.shopTwoList; 
// console.log(this.shopTwoList)
      this.setData({
        ShopList:res.data.message
      })
  }
})
